#include <ostream>
class Solution {
public:
    /**
     * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
     *
     * 
     * @param A int整型vector<vector<>> 
     * @param f int整型vector<vector<>> 
     * @return int整型vector<vector<>>
     */
     int dx[4] = {1, -1, 0, 0};
     int dy[4] = {0, 0, 1, -1};
    vector<vector<int> > flipChess(vector<vector<int> >& A, vector<vector<int> >& f) {
        int m = A.size();
        int size = f.size();
        for(int i = 0; i < size; i++)
        {
            int _x = f[i][0] - 1, _y = f[i][1] - 1;
            std::cout << "i: " <<"_x: " << _x << "_y: " <<_y << endl;
            for(int k = 0; k < 4; k++)
            {
                int x = _x + dx[k], y = _y + dy[k];
                if(x < 0 || x >= m || y < 0 || y >= m) continue;
                            std::cout << "k: "  << k <<" x: " << x << " y: " << y << endl;
                A[x][y] = (A[x][y] + 1) % 2;
            }
                    std::cout << "ok" << std::endl;
        }
        return A;
    }
};